package com.imusic;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableCircuitBreaker
@EnableHystrix
@EnableHystrixDashboard
@RestController
public class OrderApplication {

  public static void main(String[] args) throws Exception {
    SpringApplication.run(OrderApplication.class, args);
  }

  @Autowired
  private OrderService orderService;

  @RequestMapping("/startOrder")
  public String startOrder() throws InterruptedException {
    return orderService.startOrder();

  }
}
